<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>文章预览</title>
</head>
<body>
<div id="detail"></div>
</body>
<!-- jquery -->
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js"></script>
<script>
    function getQueryString(name) {
        var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
        var r = window.location.search.substr(1).match(reg);
        if (r != null) {
            return unescape(r[2]);
        }
        return null;
    }
    var id=getQueryString("id");
    var settings = {
        "url": "/api/cms/web/article/"+id,
        "method": "GET"
    };
    $.ajax(settings).done(function (response)
    {
        var html="<h3 style='text-align: center'>"+response.data.title+"</h3>\n";
        var articleContent = response.data.articleContent;
        if(typeof (articleContent) != 'undefined' && articleContent!=null)
        {
            html += "<p>"+articleContent.content+"</p>\n";
        }
        $("#detail").html(html);
    });
</script>
</html>